﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace MapEngine
{
    public struct CellDef
    {
        public UInt32 tile;
        public CellFlags flags;

        public CellDef(UInt32 _tile = 0, CellFlags _flags = CellFlags.Nothing)
        {
            tile = _tile;
            flags = _flags;
        }


        public void Save(BinaryWriter writer)
        {
            writer.Write((UInt32)tile);
            writer.Write((UInt32)flags);
        }


        public void Load(BinaryReader reader)
        {
            tile = reader.ReadUInt32();
            flags = (CellFlags)reader.ReadUInt32();
        }
    }


    [Flags]
    public enum CellFlags
    {
        Nothing = 0x00,
        Explored = 0x01,
        Visible = 0x02,
        Occupied = 0x04,
        Closed = 0x08
    }
}
